package com.google.sydym6.logic.utils;

import java.lang.reflect.Field;

import com.google.sydym6.R;

import android.content.Context;
import android.util.Log;

public class ResourceUtils {

	public static int getResourceId(String variableName, Context context, Class<?> c) {
	    try {
	        Log.v("database", "Field: " + c.getDeclaredField(variableName));
	        Log.v("database", "variableName: " + variableName);
	        Field idField = c.getDeclaredField(variableName);
	        return idField.getInt(idField);
	    } catch (Exception e) {
	        Log.w("database", variableName + " : " + e.getMessage());
	        return R.drawable.no_cover_art;
	    }
	}
}
